<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ include file="base.jsp" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	 <base href="<%=basePath%>">
	<meta charset="UTF-8">
	<title>新联系人</title>
	<link rel="stylesheet" href="<%=basePath%>css/bootstrap.css" />
	<link rel="stylesheet" href="<%=basePath%>js/bootstrap.min.js" />
	<link href="<%=basePath%>css/bootstrap-responsive.css" rel="stylesheet">
    <link href="<%=basePath%>js/google-code-prettify/prettify.css" rel="stylesheet">
	<link rel="shortcut icon" href="<%=basePath%>img/logo.jpg">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%=basePath%>img/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%=basePath%>img/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%=basePath%>img/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="<%=basePath%>img/apple-touch-icon-57-precomposed.png">
	
	<script type="text/javascript" src="<%=basePath%>js/jquery.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/google-code-prettify/prettify.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-transition.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-alert.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-modal.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-dropdown.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-scrollspy.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-tab.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-tooltip.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-popover.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-button.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-collapse.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-carousel.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-typeahead.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-affix.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/application.js"></script>
	<style type="text/css">
		.navbar{
			background-color:#999999;
		
		}
		body{
			background-color:#F3F1EC;
		
		
		.span6{
			border: 1px solid #DADEE5;
			border-top-left-radius: 5px;
			border-top-right-radius: 5px;
			margin: 0;
			padding: 15px 30px;
			height:auto;
		}
		#word{
			background:#F0F5F8;
		}
		
		
	</style>
</head>
<body>
	<div id="container">
		<%@ include file="top.jsp"%>
		<div id="content">
			
			<div id="left" class="span3">
				<jsp:include page="lefttop.jsp">
					<jsp:param value="contact" name="tag"/>
				</jsp:include>
				<%@ include file="leftdown.jsp" %>
			
			</div>
			
			<div class="span6" >
				<form action="<%=basePath%>contact/addcompany.action" method="post">
				<input type="hidden" name="contact.userid" value="${session.nowUser.id }"/>
				<input type="hidden" name="phonetype.userid" value="${session.nowUser.id }"/>
				<input type="hidden" name="info.userid" value="${session.nowUser.id }"/>
				<input type="hidden" name="user.username" value="${session.nowUser.username }"/>
				<div id="word" style="background:#F0F5F8;border: 1px solid #DADEE5;border-top-left-radius: 5px;border-top-right-radius: 5px;margin: 0;padding: 15px 30px;">
					
					<b>名称</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="contact.company" type="text"  id="name"/><br />
				</div>
				
				
				<div class="form" style="background:#fff; padding:20px;" id="myform">
					
						<div id="phone" style="border-bottom: 1px solid #DADEE5;padding-bottom:10px;padding-left:15px;min-height:30px;padding-top:5px;">
							<b>电话</b><hr/>
							<div id="add"></div>
							<a href="javascript:" id="ee" style="background-color:#999;width:100px;;"><i class="icon-plus-sign"></i>添加一个号码</a>
						</div>
						<div id="email" style="border-bottom: 1px solid #DADEE5;padding-bottom:10px;padding-left:15px;min-height:30px;padding-top:5px;">
							<b>Email</b><hr/>
							<div id="addemail"></div>
							<p  id="aa" style="background-color:#999;width:100px;;"><i class="icon-plus-sign"></i>添加Email</p>
						</div>
						
					
						<b>QQZone</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="contact.qqzone" style="margin-top:10px;"/><br />
						<div class="backinfo" style="border-bottom:1px solid #DADEE5;resize:none;">
							<small><b>背景资料</b></small><br />
							 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
							 <textarea name="contact.note" id="" cols="30" rows="5" class="span3" style="resize:none;"></textarea>
						
						</div>
						
						<div style="margin-top:10px;">
							<button class="btn btn-primary span2" id="sub" >添加联系人</button>或 <a class="btn btn-primary"   onclick=history.go(-1) >取消添加</a>
						</div>
					
				</div>
				
				</form>
			
			
			
			</div>
			<div class="span3">
				<div class="taskbox" style="background:#f8f8f8;">
					<div class="boxcontent" style=" padding: 12px 15px;margin: 0;border:1px solid #DADEE5;">
						<p><b>快速添加联系人</b></p>
						<hr style="margin:5px;"/>
						<b style="font-size:12px;">你想快速添加多个联系人么？你可以尝试以下方法：<br/><a href="<%=basePath%>contact/toaddmany.action?userid=${session.nowUser.id }">通过导入excel</a></b>
						
					</div>
				
				</div>
			
			</div>
			
			
		
		</div>
		
	
	
	
	</div>
	<script type="text/javascript">
			$(document).ready(function () {  
								
				$(".tip").tooltip();
				
				//name not null  validate
				
				
				$("#sub").click(function(){
					var v=$("#").html();
					if(v.trim()==null){
						$("#nameinfo").html("x该项必填");
						$("#name").focus();
						return;
					}
					$("#myform").submit();
					
				});
			  //添加电话
			
			$("#ee").live("click", function(){
				 
				    $("#add").append("<div><input type='text' name='phonetype.valuea' class='input-xlarge'/><span class='del-text' ><i class='icon-trash'></i></span></div>");
				});
			$("#aa").live("click", function(){
				 
				    $("#addemail").append("<div><input type='text' name='emailtype.valuea' class='input-xlarge'/><span class='del-text' ><i class='icon-trash'></i></span></div>");
				});
				
				
			$(".del-text").live("click",function(){ 
				$(this).parent().remove(); 
				i--; 
			}); 
			
			});		
				
			
			
		
			
		
		
				
	</script>




	
</body>
</html>
